/*
package linkedList;

public class MyLinkedList {
    int length;
    Node head;//头指针永远指向最后一个节点
    Node end;//尾指针指向最后一个节点
    public void add(Object o) {//添加节点
        Node node = new Node(o);
        if(length == 0) {//如果链表长度为0，那么创建一个带有一个节点的单链表
            head = node;
            end =head;
        } else {//否则应该创建一个几点连接在表上
            end.next =node;//连接在链表上
            end = node;//永远指向最后一个节点
        }
        length++;
    }
    public void print() {
        Node endNode = head;
        while(endNode.next != null) {
            System.out.println(endNode.o);
            endNode = endNode.next;
        }
        System.out.println(endNode.o);
    }
    public void remove (int index) {

        Node end = head;
        int count = 0;
       if (index == this.length) {
           while (count != index -2) {  //删除最后一个节点
               end = end.next;//end指向要删除元素的前一个
               count++;
           }
           this.end = end;
           end = null;
       } else if(index == 1) {//如果删除第一个元素
           end = end.next;
           this.head =end;
       } else {
           while (count != index -2) {
               end = end.next;
               count++;
               end.next = end.next.next;
           }
       }
        length--;
        System.out.println("删除成功");
    }
    public int search(Object o) {
        Node n = head;
        int count = 0;

        while(o.equals())

    }
    public void size() {
        System.out.println("链表当前长度： " + this.length);
    }

    public MyLinkedList() {

    }
}
*/
